﻿Imports AccesoDatos

Public Class CatalogoConsolidado

    Public Function BandejaDetalleConsolidado(ByVal pstrLocal As String, ByVal pstrFecha As String) As DataSet
        Dim dsConsultaDatos As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                       {"@FECHA", SqlDbType.VarChar, UCase(pstrFecha)}}
        dsConsultaDatos = objCom.ExecSPDataSetCP("SP_BANDEJA_DETALLE_CONSOLIDADO", Parametros)
        Return dsConsultaDatos
    End Function


    Public Function AdicionalesDetalleConsolidado(ByVal pstrLocal As String, ByVal pstrFecha As String) As DataSet
        Dim dsConsultaDatos As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                       {"@FECHA", SqlDbType.VarChar, UCase(pstrFecha)}}
        dsConsultaDatos = objCom.ExecSPDataSetCP("SP_ADICIONAL_DETALLE_CONSOLIDADO", Parametros)
        Return dsConsultaDatos
    End Function



    Public Function InsertarPrecioPolloNormal(ByVal pstrFecha As String, ByVal pstrPeso As String, ByVal pstrCosto As String, ByVal pstrUsuario As String) As Integer
        Dim rs As Integer

        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@FECHA", SqlDbType.VarChar, UCase(pstrFecha)}, _
                                       {"@PESO", SqlDbType.VarChar, UCase(pstrPeso)}, _
                                       {"@COSTO", SqlDbType.VarChar, UCase(pstrCosto)}, _
                                       {"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}}

        rs = objCom.ExecSPIntegerCP("SP_INSERTA_PRECIOPOLLO_NORMAL", Parametros)
        Return rs
    End Function

    Public Function InsertarPrecioPolloEspecial(ByVal pstrFecha As String, ByVal pstrLocal As String, ByVal pstrPeso As String, ByVal pstrCosto As String, ByVal pstrUsuario As String) As Integer
        Dim rs As Integer

        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@FECHA", SqlDbType.VarChar, UCase(pstrFecha)}, _
                                       {"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                       {"@PESO", SqlDbType.VarChar, UCase(pstrPeso)}, _
                                       {"@COSTO", SqlDbType.VarChar, UCase(pstrCosto)}, _
                                       {"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}}

        rs = objCom.ExecSPIntegerCP("SP_INSERTA_PRECIOPOLLO_ESPECIAL", Parametros)
        Return rs
    End Function


    Public Function InsertarPrecioPolloOtro(ByVal pstrFecha As String, ByVal pstrLocal As String, ByVal pstrItem As String, ByVal pstrCosto As String, ByVal pstrUsuario As String) As Integer
        Dim rs As Integer

        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@FECHA", SqlDbType.VarChar, UCase(pstrFecha)}, _
                                       {"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                       {"@ITEM", SqlDbType.VarChar, UCase(pstrItem)}, _
                                       {"@COSTO", SqlDbType.VarChar, UCase(pstrCosto)}, _
                                       {"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}}

        rs = objCom.ExecSPIntegerCP("SP_INSERTA_PRECIOPOLLO_OTRO", Parametros)
        Return rs
    End Function


    Public Function BandejaPrecioPollo(ByVal pstrLocal As String, ByVal pstrFecha As String, ByVal pstrItem As String) As DataSet
        Dim dsConsultaDatos As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                       {"@FECHA", SqlDbType.VarChar, UCase(pstrFecha)}, _
                                       {"@ITEM", SqlDbType.VarChar, UCase(pstrItem)}}
        dsConsultaDatos = objCom.ExecSPDataSetCP("SP_BANDEJA_PRECIOPOLLO", Parametros)
        Return dsConsultaDatos
    End Function


    Public Function BandejaGastoConsolidado(ByVal pstrLocal As String, ByVal pstrInsumo As String, ByVal pstrFecha1 As String, ByVal pstrFecha2 As String) As DataSet
        Dim dsConsultaDatos As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                       {"@INSUMO", SqlDbType.VarChar, UCase(pstrInsumo)}, _
                                       {"@FECHA1", SqlDbType.VarChar, UCase(pstrFecha1)}, _
                                       {"@FECHA2", SqlDbType.VarChar, UCase(pstrFecha2)}}
        dsConsultaDatos = objCom.ExecSPDataSetCP("SP_BANDEJA_GASTO_CONSOLIDADO", Parametros)
        Return dsConsultaDatos
    End Function

    Public Function BandejaGastoConsolidadoTotal(ByVal pstrLocal As String, ByVal pstrInsumo As String, ByVal pstrFecha1 As String, ByVal pstrFecha2 As String) As DataSet
        Dim dsConsultaDatos As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                       {"@INSUMO", SqlDbType.VarChar, UCase(pstrInsumo)}, _
                                       {"@FECHA1", SqlDbType.VarChar, UCase(pstrFecha1)}, _
                                       {"@FECHA2", SqlDbType.VarChar, UCase(pstrFecha2)}}
        dsConsultaDatos = objCom.ExecSPDataSetCP("SP_BANDEJA_GASTO_CONSOLIDADO_TOTAL", Parametros)
        Return dsConsultaDatos
    End Function


End Class
